#ifndef SYSTEM_H_20110325
#define SYSTEM_H_20110325

#include "GlobalDef.h"

class CApplication
{
public:
	int  Run();

	bool ResizeWindow(int width, int height);
	void ShowMouse(bool bShow);

	HWND      GetWnd()  const {return m_hWnd;}
	HINSTANCE GetInst() const {return m_hInst;}

	virtual LRESULT CALLBACK MsgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
	{
		return DefWindowProc(hWnd, uMsg, wParam, lParam);
	}

protected:
	CApplication();

	virtual bool Init() {return true;}
	virtual bool Main() {return true;} 
	virtual bool Shut() {return true;}

private:

	HWND      m_hWnd;
	HINSTANCE m_hInst;

	LPCTSTR m_szCaption;
	LPCTSTR m_szClass;

	int m_xPos;
	int m_yPos;
	int m_width;
	int m_height;
};

static CApplication *g_pApp = NULL;
static LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);


#endif